SftTree/OCX 7.0

SftTree.OLEGiveFeedback Event

Softel vdm, Inc.

The OLE drag & drop operation is in progress, used for visual feedback.

Syntax       

VB.NET

Private Sub object_OLEGiveFeedback(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.OLEGiveFeedback

VB

Private Sub object_OLEGiveFeedback(Effect As Long, DefaultCursors As Boolean)

C#.NET

void object_OLEGiveFeedback(object sender, EventArgumentType e);

VC++

void OnOLEGiveFeedbackobject(long* Effect, VARIANT_BOOL* DefaultCursors);

C

HRESULT OnOLEGiveFeedbackobject(long* Effect, VARIANT_BOOL* DefaultCursors);

Delphi

procedure objectOLEGiveFeedback(Sender: TObject; var Effect : Integer; var DefaultCursors : WordBool);

object

A SftTree object.

Effect

Set by the target component in the OLEDragOver event specifying the action to be performed if the user drops the selection on it.  This allows the source to take the appropriate action (such as giving visual feedback).

Effect

Value

Description

vbDropEffectNone

0

Drop target cannot accept the data.

vbDropEffectCopy

1

Drop results in a copy of data from the source to the target.  The original data is unaltered by the drag operation.

vbDropEffectMove

2

Drop results in data being moved from the drag source to the drop source.  The drag source should remove the data from itself after the move.

Note: Only Visual Basic offers the predefined constants vbDropEffectNone, etc. When using other languages, the constants have to be defined explicitly by the application.

DefaultCursors

Determines whether the default mouse cursor provided by the component is used, or a user-defined mouse cursor is used.  If set to True, the default mouse cursor is used, otherwise the mouse cursor defined using the MousePointer property (of the Screen object) is used instead.

Comments

The OLEGiveFeedback event occurs when the OLE drag & drop operation is in progress, used for visual feedback.

The OLEGiveFeedback event occurs after every OLEDragOver event.  OLEGiveFeedback allows the source component to provide visual feedback to the user, such as changing the mouse cursor to indicate what will happen if the user drops the object, or provide visual feedback on the selection (in the source component) to indicate what will happen.

If there is no code in the OLEGiveFeedback event, or if the DefaultCursors parameter is set to True, the default cursor provided by the component is used as the mouse cursor.

The source control should always mask values from the Effect parameter to ensure compatibility with future implementations of drag & drop.  Presently, only three bits in the Effect parameter are used. In future versions other bits may be used.  As a precaution against future problems, drag sources and drop targets should mask these values appropriately before performing any comparisons.

For example, a source component should not compare an Effect against, for example, vbDropEffectCopy, such as:

If Effect = vbDropEffectCopy...  

Instead, the source component should mask the value or values being sought, as here:

If Effect And vbDropEffectCopy = vbDropEffectCopy...  

-or-

If (Effect And vbDropEffectCopy)...  

This allows for the definition of new drop effects in future versions while preserving compatibility with your existing code.

See Also  SftTree Object | Object Hierarchy


Feedback / comments / error reports for this topic
© 2015 - Softel vdm, Inc. - www.softelvdm.com